﻿@{
    ViewData["Title"] = "会计档案检索";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head{
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />

    <link href="/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet" />
    <style type="text/css">
        #toolbar {
            margin-top: 10px;
        }

        .dSearch .btn {
            margin-top: -3px;
        }

        .dSearch .form-control {
            display: inline-block;
        }

        .dataTables_wrapper {
            padding-bottom: 0px;
        }

        div.dataTables_scrollBody table {
            margin-top: -18px !important;
        }

        .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
            margin-bottom: 0px;
        }

        #dSearch table tr td {
            padding: 8px;
        }

        #dSearch .input-group {
            width: 100%;
            margin-bottom: 16px;
        }

        #dSearch .input-group-addon {
            width: 100px;
        }

        #dSearch .fix-border {
            border-left: none;
            border-right: none;
        }

        .dSearch .form-control {
            display: inline-block;
        }

        .dSearcha a.btn {
            margin-top: 0;
        }
    </style>
}
<form id="form1" runat="server">
    <div id="dMain">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="ibox" style="margin-bottom: 0px;">
                <div class="ibox-title">
                    <h5>会计档案-<%=Title() %></h5>
                    <div class="ibox-tools">
                        <a class="btn btn-primary btn-circle btn-outline" title="刷新" href="javascript:location.href=location.href;" style="margin-top: -7px;"><i class=" fa fa-refresh"></i></a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="dSearch dSearcha">
                        <asp:TextBox ID="txtFileNo" runat="server" CssClass="form-control" placeholder="档号" Width="120"></asp:TextBox>
                        <asp:DropDownList ID="ddlFTerm" runat="server" CssClass="form-control" Width="100"></asp:DropDownList>
                        <asp:TextBox ID="txtAY" runat="server" CssClass="form-control" placeholder="实物说明" Width="200"></asp:TextBox>
                        <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnSearch_Click"><i class="icon-search"></i>&nbsp;快速检索</asp:LinkButton>
                        <a id="ShowSearch" class="btn btn-sm btn-primary" onclick="ShowDivOfPage('#myModal','综合检索',500,510)"><i class="icon-search"></i>&nbsp;综合检索</a>
                        <asp:LinkButton ID="lbtnAll" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnAll_Click"><i class="icon-table"></i>&nbsp;查看全部</asp:LinkButton>
                    </div>
                    <div id="toolbar" class="dSearch">

                    </div>
                    <table id="tabData" class="table table-bordered" style="width: 3400px;">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>案卷级档号</th>
                                <th>全宗号</th>
                                <th>会计年度</th>
                                <th>保管期限</th>
                                <th>实体分类号</th>
                                <th>案卷号</th>
                                <th>题名</th>
                                <th>页数</th>
                                <th>文件开始日期</th>
                                <th>文件截止日期</th>
                                <th>会计类别</th>
                                <th>录入时间</th>
                                <th>录入人</th>
                                <th>文档单位</th>
                                <th>凭证名称</th>
                                <th>财会主管</th>
                                <th>经办会计</th>
                                <th>月份</th>
                                <th>总量</th>
                                <th>分册</th>
                                <th>前册号</th>
                                <th>后册号</th>
                                <th>科室</th>
                                <th>凭证号起</th>
                                <th>凭证号止</th>
                                <th>备注</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div id="myModal" style="display: none;">
        <div id="dSearch" class="modal-body" style="height: 415px;">
            <div class="input-group">
                <span class="input-group-addon">题名</span>
                <asp:TextBox ID="txtTitle" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">会计年度</span>
                <asp:TextBox ID="txtKJYear1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtKJYear2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">档号</span>
                <asp:TextBox ID="txtDH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">目录号</span>
                <asp:TextBox ID="txtMLH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">会计类别</span>
                <asp:DropDownList ID="ddlKJType" runat="server" CssClass="form-control"></asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon">保管期限</span>
                <asp:DropDownList ID="ddlTerm" runat="server" CssClass="form-control"></asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon">案卷号</span>
                <asp:TextBox ID="txtAJH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">实体分类号</span>
                <asp:TextBox ID="txtSTFLH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">总册数</span>
                <asp:TextBox ID="txtTotalVolume1" runat="server" CssClass="form-control" dataType="zzs" Msg="总册数格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtTotalVolume2" runat="server" CssClass="form-control" dataType="zzs" Msg="总册数格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">第几册</span>
                <asp:TextBox ID="txtCH1" runat="server" CssClass="form-control" dataType="zzs" Msg="第几册格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtCH2" runat="server" CssClass="form-control" dataType="zzs" Msg="第几册格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">凭证号开始 </span>
                <asp:TextBox ID="txtPZH1" runat="server" CssClass="form-control" dataType="zzs" Msg="凭证号格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtPZH2" runat="server" CssClass="form-control" dataType="zzs" Msg="凭证号格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">凭证号截止</span>
                <asp:TextBox ID="txtPZH3" runat="server" CssClass="form-control" dataType="zzs" Msg="凭证号格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtPZH4" runat="server" CssClass="form-control" dataType="zzs" Msg="凭证号格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">件数</span>
                <asp:TextBox ID="txtItemNo1" runat="server" CssClass="form-control" dataType="zzs" Msg="件数格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtItemNo2" runat="server" CssClass="form-control" dataType="zzs" Msg="件数格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">页数</span>
                <asp:TextBox ID="txtPageCount1" runat="server" CssClass="form-control" dataType="zzs" Msg="页数格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtPageCount2" runat="server" CssClass="form-control" dataType="zzs" Msg="页数格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">文件开始时间</span>
                <asp:TextBox ID="txtStartDate1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})" dataType="int" Msg="文件开始时间格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtStartDate2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})" dataType="int" Msg="文件开始时间格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">文件截止时间</span>
                <asp:TextBox ID="txtEndDate1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})" dataType="int" Msg="文件结束时间格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtEndDate2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})" dataType="int" Msg="文件结束时间格式不正确!"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">立档单位</span>
                <asp:TextBox ID="txtBuildUnit" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">凭证名称</span>
                <asp:TextBox ID="txtProofName" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">财会主管</span>
                <asp:TextBox ID="txtCKZG" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">经办会计</span>
                <asp:TextBox ID="txtJBKJ" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">前册号</span>
                <asp:TextBox ID="txtBeforeNo" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">后册号</span>
                <asp:TextBox ID="txtAfterNo" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">科室</span>
                <asp:TextBox ID="txtDepartments" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group" style="margin-bottom: 0px;">
                <span class="input-group-addon">备注</span>
                <asp:TextBox ID="txtRemark" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
        </div>
        <div class="modal-footer">
            <asp:Button ID="btnSearch" runat="server" CssClass="btn btn-primary btn-sm" OnClientClick="return verfic('tip', '#dSearch');" OnClick="btnSearch_Click" Text="检索" />
            <input id="btnClose" type="button" class="btn btn-default btn-sm" value="取消" onclick="CloseDiv()" />
        </div>
    </div>

    <input id="hfLogInfo" type="hidden" value="删除了一条数据" />
    <input id="hfModular" type="hidden" value="会计档案" />
    <input id="hfPageUrl" type="hidden" value="<%=Request.Url.PathAndQuery %>" />

</form>
@section scripts{
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-export.js"></script>
    <script src="/js/plugins/bootstrap-table/tableExport.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-cookie.js"></script>

    <script src="/js/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/plugins/layer/layer.min.js"></script>
    <script src="/js/store.js"></script>
    <script src="/js/verification.js"></script>
    <script src="/js/zuiCode.js"></script>

    <script type="text/javascript">
        $(function () {
            var tabHeight = document.documentElement.clientHeight - 140;
            $('#tabData').bootstrapTable({
                height: tabHeight,
                data: $("#dJson").text() != "" ? JSON.parse($("#dJson").text()) : "",
                dataType: "json",
                columns: [
                    { align: 'center', width: "50px", checkbox: true },
                    { field: 'AJDH', align: 'center', width: "180px", sortable: true },
                    { field: 'QZH', align: 'center', width: "80px", sortable: true },
                    { field: 'KJYear', align: 'center', width: "100px", sortable: true },
                    { field: 'Term', align: 'center', width: "100px", sortable: true },
                    { field: 'STFLH', align: 'center', width: "100px", sortable: true },
                    { field: 'AJH', align: 'center', width: "80px", sortable: true },
                    { field: 'Title', align: 'left' },
                    { field: 'PageCount', align: 'center', width: "80px", sortable: true },
                    { field: 'StartDate', align: 'center', width: "100px", sortable: true },
                    { field: 'EndDate', align: 'center', width: "100px", sortable: true },

                    { field: 'KJType', align: 'center', width: "150px", sortable: true },
                    { field: 'WriteTime', align: 'center', width: "200px", sortable: true, formatter: DateFormatter },
                    { field: 'UserName', align: 'center', width: "150px", sortable: true },
                    { field: 'BuildUnit', align: 'center', width: "150px", sortable: true },
                    { field: 'ProofName', align: 'center', width: "150px", sortable: true },
                    { field: 'CKZG', align: 'center', width: "150px", sortable: true },
                    { field: 'JBKJ', align: 'center', width: "150px", sortable: true },
                    { field: 'Months', align: 'center', width: "80px", sortable: true },
                    { field: 'TotalVolume', align: 'center', width: "80px", sortable: true },
                    { field: 'PartVolume', align: 'center', width: "80px", sortable: true },


                    { field: 'BeforeNo', align: 'center', width: "80px", sortable: true },
                    { field: 'AfterNo', align: 'center', width: "80px", sortable: true },
                    { field: 'Departments', align: 'center', width: "150px", sortable: true },
                    { field: 'PZH1', align: 'center', width: "80px", sortable: true },
                    { field: 'PZH2', align: 'center', width: "80px", sortable: true },
                    { field: 'Remark', align: 'center', width: "150px", sortable: true },
                ],
                toolbar: '#toolbar',//工具按钮用哪个容器
                buttonsClass: "sm btn-white",//按钮class
                pageSize: 100,//分页条数
                clickToSelect: true,//设置true将在点击行时，自动选择单选或复选框
                singleSelect: false,//为true则禁止多选
                cache: false,//是否缓存
                cookie: true,//是否启用cookie
                cookieIdTable: "Accounting",//cookie键值
                pagination: true,//是否分页
                showColumns: true,//是否显示所有的列
                showRefresh: true,//是否显示刷新按钮
                search: true,//是否启用搜索
                showPaginationSwitch: true,//是否显示分页切换按钮
                showExport: true,//是否启用导出
                striped: false,//是否显示行间隔色
                onDblClickRow: function (row, obj) { //双击行事件
                    location.href = "ImageSon.aspx?ParentID=" + (row.ID);
                },
                onClickRow: function (row, obj) { //单击行事件
                    $(obj).parent().find("tr").removeClass("selected");
                    $(obj).addClass("selected");

                    //根据选中的行获取子表数据
                    //  GetSonData(row.ID, row.Flag3);
                },
                onSearch: function (text) {
                    if (text != "") {
                        $("#tabData tbody tr").each(function (z) {
                            $("td:not(.bs-checkbox)", this).each(function (i) {
                                if (i != 0) {
                                    var str = "<span class=\"bg-yellow\">" + text + "</span>";
                                    var NewText = $("#tabData tbody tr").eq(z).find("td").eq(i).text().replaceAll(text, str);
                                    $("#tabData tbody tr").eq(z).find("td").eq(i).html(NewText);
                                }
                            })
                        })
                    }
                }
            });
        })

    </script>
}
